import "./assets/main.css";

import { createApp, nextTick } from "vue";
import { createPinia } from "pinia";

import App from "./App.vue";
import router from "./router";
import * as Icons from "@ant-design/icons-vue";

import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'

// 必须使用 nextTick，不然会有加载顺序问题，导致绑定失败
nextTick(() => {
  // 配置全局对象
  app.config.globalProperties.$icons = Icons;
  // Antd 注入全部图标（这样注入之后，就可以全局直接使用 icon 组件，不需要每个页面去引入了）
  for (const key in Icons) {
    app.component(key, Icons[key]);
  }
});

import Antd from "ant-design-vue";

import "ant-design-vue/dist/antd.css";

const app = createApp(App);
app.use(ElementPlus)
app.use(Antd);
app.use(createPinia());
app.use(router);

app.mount("#app");
